#include "Shm.hpp"
#include "namedPipe.hpp"

int main()
{
    // 1.创建共享内存
    Shm shm(gpathname, gproj_id, gUser);
    char* shmaddr = (char*)shm.GetShmAddr();
    sleep(3);
    // 2.创建管道
    NamedPipe fifo(comm_path, User);
    fifo.OpenForWrite();

    // 当做string
    char ch = 'A';
    while (ch <= 'Z')
    {
        shmaddr[ch - 'A'] = ch;

        std::string temp = "wakeup";
        fifo.WriteNamedPipe(temp);
        std::cout << "add " << ch << " into shm, " << "wakeup reader" << std::endl;
        sleep(2);
        ch++;
    }

    return 0;
}